
#ifndef TOOLFILL_H
#define TOOLFILL_H

#include <QStack>
#include "editortool.h"

class ImageEditor;
class ToolFill : public EditorTool
{
public:
	ToolFill(ImageEditor* parent);
	virtual ~ToolFill();

	virtual void mousePress(const QPoint& p);
	virtual void mouseRelease(const QPoint& p);
	virtual void mouseMove(const QPoint& p);
	virtual QRect draw(QPainter* p);

private:
	QRect boundingRect(const QPoint& p);
	void fillLine(QPainter* painter, const QPoint& p, QStack<QPoint>& stack, const QColor& oldColor);

	bool m_drawing;
	QPoint m_prev;
	QPoint m_current;
};


#endif

